﻿using Mohe.Scada.Util.Models;

namespace IPlugin
{
    /// <summary>
    /// 写入地址IO模型
    /// </summary>
    public class DriverAddressIoArgModel
    {
        public string ID { get; set; } = string.Empty;
        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get; set; } = string.Empty;
        /// <summary>
        /// 值
        /// </summary>
        public object Value { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        public EnumDataType ValueType { get; set; }
        /// <summary>
        /// 字节序
        /// </summary>
        public EnumDataFormat DataFormat { get; set; }
        /// <summary>
        /// 偏移量
        /// </summary>
        public int Offset { get; set; }
        /// <summary>
        /// 比特位
        /// </summary>
        public int Bit { get; set; }
        public override string ToString()
        {
            return $"变量ID:{ID},Address:{Address},Value:{Value},ValueType:{ValueType},Endian:{DataFormat}";
        }
    }
}
